package com.zhang.Adapter.example;

import java.util.Map;

/**
 * @author ElloeStudy(Sifa Zhang)
 * @create 2022-03-02 19:05
 * To: 真常应物，真常得性，常清常静，常清静矣
 */

// 把外系统上的OuterUser 包装称为 UserInfo
    // 包装的过程就是 继承外系统的，实现自己系统的接口，即这两个的系统就可以接在一起
public class OuterUserInfo extends OuterUser implements IUserInfo{
    private Map<String,String> baseInfo = super.getUserBaseInfo();  // 员工的基本情况
    private Map<String,String> officeInfo = super.getUserOfficeInfo();  // 员工的家庭信息
    private Map<String,String> homeInfo = super.getUserHomeInfo();  // 员工的工作信息
    @Override
    public String getUserName() {
        String userName = this.baseInfo.get("userName");
        System.out.println(userName);
        return userName;
    }

    @Override
    public String getHomeAddress() {
        String homeAddress = this.homeInfo.get("homeAddress");
        System.out.println(homeAddress);
        return homeAddress;
    }

    @Override
    public String getMobileNumber() {
        String mobileNumber = this.baseInfo.get("mobileNumber");
        System.out.println(mobileNumber);
        return mobileNumber;
    }

    @Override
    public String getOfficeTelNumber() {
        String officeNumber = this.officeInfo.get("officeNumber");
        System.out.println(officeNumber);
        return officeNumber;
    }

    @Override
    public String getJobPosition() {
        String jobPosition = this.officeInfo.get("jobPosition");
        System.out.println(jobPosition);
        return jobPosition;
    }

    @Override
    public String getHomeTelNumber() {
        String homeTelNumber = this.homeInfo.get("homeTelNumber");
        System.out.println(homeTelNumber);
        return homeTelNumber;
    }
}
